package com.srd.phone.bean;

import com.srd.phone.utils.CommonUtils;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

public class InviteFriends {

    public String username;
    public String ctime;
    public String moneys;

    public static List<InviteFriends> parseData(String json){
        List<InviteFriends> list = new ArrayList<InviteFriends>();
        try {
            JSONArray jsonArray = new JSONArray(json);
            for (int i = 0; i < jsonArray.length(); i++) {
                InviteFriends item = new InviteFriends();
                JSONObject jsonObject = jsonArray.getJSONObject(i);
                item.ctime = CommonUtils.formatDataStr(jsonObject.optString("ctime"));
                item.username = jsonObject.optString("username");
                item.moneys = jsonObject.optString("moneys");
                list.add(item);
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return list;
    }
}

